var url = "http://" + buildURL() + "/";
/* COMMON */
function getNodeProperty(obj){
        initID  = obj.id.split("_")[1];
        id = "innerNode_"+initID;
        node_type = $(obj).attr("node-type");
        $("#node_id").val(id);
        //validate if orgchart or workflow
	
        switch(node_type){
                //Workflow
                case "1":
                        //Processor and Processor Type
                        getProcessorType(initID,0);
                        break;
                //Orgchart
                case "2":
			if($(obj).attr("node_data")!=""){
				//Department
				getDepartment(initID)
				//Get the property of node in json
				var node_data =  jQuery.parseJSON($("#node_"+initID).attr("node_data"));
				//Head
				arrangeUsersOrgChart("orgChartHead",node_data.orgChartHead)
				//Assistant Head
				arrangeUsersOrgChart("orgChartAsstHead",node_data.orgChartAsstHead)
				//Members
				arrangeUsersOrgChart("orgChartMembers",node_data.orgChartMembers)
				break;		
			}
        }
	
        //get css
        $(".nodeHeight").val(parseInt($("#"+id).css("height")));
        $(".nodeWidth").val(parseInt($("#"+id).css("width")));
        //Deactivate all nodes
        $(".outerNode").removeClass("greenNode");
        //Activate the node
        $(obj).addClass("greenNode");
}
function setNodeProperty(obj, property){
        id = $("#node_id").val();
        initID  = id.split("_")[1];
	switch(property){
                //Both Orgchart and Workflow
		case "Width":
			$("#"+id).css('width', obj.value);
			break;
                case "Height":
			$("#"+id).css('height', obj.value);
			break;
                //Orgchart
                case "Dept":
                        setDepartment(initID,obj);
			break;
                //Workflow
                case "Processor Type":
                        getProcessor(obj.value,0,1);
                        break;
                case "Processor":
                        setProcessor();
                        break;
	}
}